<!DOCTYPE html>
<html id="bg">

<head>
    <%- include('./include/head', { siteTitle: themeConfig.siteName }) %>
</head>

<body>
    <%- include('./include/header') %>
        <div id="main">
            <div id="main-part">
                <ul class="posts-list">
                    <li class="lite-item">
                        <article class="post post-type">
                            <div class="post-main post-type-main">
                                <div class="post-content">
                                    <div class="post-content-real">
                                        <% let years = []; posts.forEach((item) => { const year = item.date.substring(0, 4); if (!years.includes(year)) { years.push(year); } }); %>
                                            <% years.forEach(function(year) { %>
                                                <h3>
                                                    <%- year %>
                                                </h3>
                                                <% posts.forEach(function(post) { %>
                                                    <%if (post.date.indexOf(year) !== -1) { %>
                                                        <article class="archive-item">
                                                            <a class="archive-item-link" href="<%- post.link%>">
                                                                <%= post.title %>
                                                            </a>
                                                            <span class="publish-time"> - <i class="fa fa-calendar"aria-hidden="true"></i> <%= post.dateFormat %></span></article>
                                                        <% } %>
                                                            <% }) %>
                                                                <% }) %>
                                    </div>
                                </div>
                            </div>
                            <div class="post-footer">
                                <% if (pagination.prev) { %>
                                    <span id="spnBtn" style="display: inline-block;width: 50%;text-align: center;font-size: 14px;float: left;border-top-left-radius: 5px;" onclick="javascript:top.location='<%= pagination.prev %>'"><i
                                    class="icon-arrow-ios-back-outline"></i> &#x4E0A;&#x4E00;&#x9875;</span>
                                    <% }else{ %>
                                        <span style="display: inline-block;width: 50%;text-align: center;font-size: 14px;float: left;"><i class="icon-arrow-ios-back-outline"></i> </span>
                                        <%}%>
                                            <% if (pagination.next) { %>
                                                <span id="spnBtn" style="display: inline-block;width: 50%;text-align: center;font-size: 14px;border-top-right-radius: 5px;" onclick="javascript:top.location='<%= pagination.next %>'"><i
                                    class="icon-arrow-ios-forward-outline"></i>&#x4E0B;&#x4E00;&#x9875;</span>
                                                <% }%>
                            </div>
                        </article>
                    </li>
                </ul>
            </div>
            <%- include('./include/sidebar') %>
        </div>

</body>
<%- include('./include/footer') %>

</html>